
#include "syscall.h"

int main(int argc, char** argv)
{
   char buf[256];
   int i, ret = 0;

   printf( "Next Thread\n" );

   for(i = 17; i <= 30; i++)
   {
	 sprintf(buf, "file%d.txt", i);
	 ret = makeFile(buf);
   }

   printf( "Closing Files\n" );

   for(i = 17; i <= 30; i++)
   {
	 sprintf(buf, "file%d.txt", i);
	 ret = unlink(buf);
   }

   return ret;
}

int makeFile( char* filename ) {
   int ret = 0;
   int fd = creat( filename );
   if( fd != -1 ) {
      printf( "FileDescriptor for %s is %d\n", filename, fd );
   } else {
      printf( "error: could not create file: %s\n", filename );
      ret = -1;
   }
   return ret;
}
